package com.example.mylearn.designPattern;

import com.example.mylearn.designPattern.strategy.AuthStrategy;
import com.example.mylearn.designPattern.strategy.StrategyFactory;
import lombok.RequiredArgsConstructor;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;


@SpringBootTest
public class factoryAndStrategy {


    @Autowired
    StrategyFactory strategyFactory;


    public static final String FRONT_AUTH = "front";
    public static final String AUTHOR_AUTH = "author";




    @Test
    public void test() {
        strategyFactory.getStrategy(FRONT_AUTH).auth();
        strategyFactory.getStrategy(AUTHOR_AUTH).auth();
    }









}
